//
// Created by Asus on 2025/6/1.
//

#include <iostream>
using namespace std;

class Base {
public:
    Base() {
        cout << "Base构造函数!" << endl;
    }

    ~Base() {
        cout << "Base析构函数!" << endl;
    }
};

class Son : public Base {
public:
    Son() {
        cout << "Son构造函数!" << endl;
    }

    ~Son() {
        cout << "Son析构函数!" << endl;
    }
};

void test01()
{
    //继承中 先调用父类构造函数，再调用子类构造函数，析构顺序与构造相反
    Son s;
}

int main(int argc, char *argv[]) {
    test01();
    return 0;
}
